package com.itheima.myprintstream;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;

public class MyPrintStream1 {
    public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException {
        //创建对象
        PrintStream ps = new PrintStream(new FileOutputStream("myio\\a.txt"), true, "UTF-8");

        ps.println(97);
        ps.print(4);
        ps.println();
        ps.printf("%s 爱上了 %s", "阿珍", "阿庆");   
        ps.close();
    }
}
